﻿using SmartPlant.Model;
using SmartPlant.Model.DbContext.Biz;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SmartPlant.Services.Interfaces
{
    /// <summary>
    /// 模板服务（包括report操作，及背后具体模板文件(<see cref="ITemplateFilesService"/>)的操作）
    /// </summary>
    public interface ITemplateSettingService : ITemplateFilesService
    {
        void GenerateExcelByReport(string proId, Dictionary<string, object> reportJob);
        #region Report相关

        /// <summary>
        /// 创建一个报表。
        /// ReportController/TemplateCreate
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        Task<RESTfulResult<string>> CreateTemplateAsync(string proId, Report report);

        /// <summary>
        /// 删除一个。
        /// ReportController/Delete
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="templateType"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        Task<RESTfulResult<string>> DeleteTemplateAsync(string proId, int templateType, Report report);

        /// <summary>
        /// 更新模板（report本身，不是背后的文件）.
        /// ReportController/TemplateUpdate
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        Task<Report> UpdateTemplateAsync(string proId, Report report);

        /// <summary>
        /// 查询report表里的记录
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        Task<List<Report>> GetTemplateLisAsync(string proId);
        /// <summary>
        /// 查询report表里的记录（按类型和输入输出）
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="type"></param>
        /// <param name="inOrOut"></param> 
        /// <returns></returns>
        Task<List<Report>> GetLisAsync(string proId, TemplateType type, int inOrOut);
        /// <summary>
        /// 查询report里的XML文件列表
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        Task<List<string>> XMLListAsync(string proId, int inOrOut, TemplateType type, string templatePath);
        #endregion
    }
}
